//求一个数的每位之和
#include <stdio.h>

int sum(int num)
{
    if(num/10)
    return num%10 + sum(num/10);
    else
    return num;
}

int main()
{
    int num = 0;
    scanf("%d", &num);
    printf("%d", sum(num));
    return 0;
}